home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tchk21.arc / INCLUDE.ARC / TIMEHK.H < prev    next >
C/C++ Source or Header  |  1989-06-20  |  1KB  |  25 lines

  1. /* TCHK 2.1 - Howard Kapustein's Turbo C library        6-6-89      */
  2. /* Copyright (C) 1988,1989 Howard Kapustein.  All rights reserved.  */
  3.  
  4. /* timehk.c  -  Howard Kapustein's time routines */
  5.  
  6. #ifndef TIMEHK_HEADER
  7. #define TIMEHK_HEADER   1
  8.  
  9. #include <howard.h>
  10.  
  11. /* function prototypes */
  12. int pause(int wait);         /* pause like delay or till keypress, returns scan code */
  13. char *timetostr(struct time *tsource, boolean seconds, boolean hundreds, boolean ampm);  /* convert time to string */
  14. struct time *strtotime(char *source);       /* convert a string to time */
  15. boolean time_convert(void *source, void *dest, int stype, int dtype);
  16. long dostimetolong(struct time *t);         /* convert a DOS time to 1/100 seconds */
  17. struct time longtodostime(long t);          /* convert a 1/100 seconds time to DOS time */
  18.  
  19. #define MAXLONGTIME     8640000l            /* 24 * 60 * 60 * 100 => # of 1/100 secs per day */
  20. #define isPM(hr)        ((hr>=12)?TRUE:FALSE)
  21. #define tohour(hr)      ((hr>12)?hr-12:(hr==0?12:hr))
  22. #define to24hour(hr)    ((hr==0)?24:hr) /* 0-23 = 24-hour clock */
  23.  
  24. #endif              /* TIMEHK_HEADER */
  25.